package com.engine4cloud.tdf.education.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.education.dto.create.EduLearningRecordCreateDTO;
import com.engine4cloud.tdf.education.dto.query.EduLearningRecordAppQueryDTO;
import com.engine4cloud.tdf.education.dto.result.EduLearningRecordResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "RemoteEduLearningRecordService", value = ServiceNameConstants.EDUCATION_SERVER)
public interface RemoteEduLearningRecordService {

    /**
     * 矫正对象学习记录列表
     *
     * @return R<PageInfo < EduLearningRecordResultDTO>>
     */
    @PostMapping("/inner/learning/record/page")
    R<PageInfo<EduLearningRecordResultDTO>> pageList(@RequestBody EduLearningRecordAppQueryDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id查询
     *
     * @param id 矫正对象id
     * @return R<List < EduLearningRecordResultDTO>>
     */
    @GetMapping("/inner/learning/record/{id}")
    R<EduLearningRecordResultDTO> getById(@PathVariable Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 新增学习记录表
     *
     * @param dto dto
     * @return R<AreaFenceResultVO>
     **/
    @PostMapping("/inner/learning/record")
    R<Boolean> create(@RequestBody EduLearningRecordCreateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);
}
